package com.wxy.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wxy.eneity.IdConnection;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author 47868
 */
@Mapper
public interface IdConnectionDao extends BaseMapper<IdConnection> {
    /**
     * 查询最大的id
     * @return 返回id
     */
    @Select("select max(id) from connections")
    int getMaxId();

    /**
     * 更新连接信息
     * @param username 用户名
     * @param password 密码
     * @param id id
     * @return 返回受影响条数
     */
    @Update("update connections set username = #{username},password = #{password} where id=#{id}")
    int updateById(String username, String password, int id);

}
